package _go

/**
 * Definition for a binary tree node.
 * type TreeNode struct {
 *     Val int
 *     Left *TreeNode
 *     Right *TreeNode
 * }
 */
func maxDepth(root *TreeNode) int {
	if root == nil { return 0}
	return dg(root)
}

func dg(root *TreeNode) int{
	if root == nil  {return 0}
	return max( dg(root.Right), dg(root.Left)) +1
}

func max(a ,b int) int{
	if a >b {
		return a
	}else{
		return b
	}
}